package com.neuralnoise.linkedin;

import org.apache.commons.configuration.Configuration;
import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.PropertiesConfiguration;

public class LinkedInProperties {

	private static final String DEFAULT_PROPERTIES_FILENAME = "linkedin.properties";
	
	private String consumerKey;
	private String consumerSecret;
	private String accessToken;
	private String tokenSecret;

	private String startUser;
	private long millis;
	
	public LinkedInProperties(String fileName) throws ConfigurationException {
		Configuration config = new PropertiesConfiguration(fileName);
		this.setConsumerKey(config.getString("linkedin.consumerKey"));
		this.setConsumerSecret(config.getString("linkedin.consumerSecret"));
		this.setAccessToken(config.getString("linkedin.accessToken"));
		this.setTokenSecret(config.getString("linkedin.tokenSecret"));
		this.setStartUser(config.getString("linkedin.startUser"));
		this.setMillis(config.getLong("linkedin.millis"));
	}

	public LinkedInProperties() throws ConfigurationException {
		this(DEFAULT_PROPERTIES_FILENAME);
	}

	public String getConsumerKey() {
		return consumerKey;
	}

	public void setConsumerKey(String consumerKey) {
		this.consumerKey = consumerKey;
	}

	public String getConsumerSecret() {
		return consumerSecret;
	}

	public void setConsumerSecret(String consumerSecret) {
		this.consumerSecret = consumerSecret;
	}

	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}

	public String getTokenSecret() {
		return tokenSecret;
	}

	public void setTokenSecret(String tokenSecret) {
		this.tokenSecret = tokenSecret;
	}

	public String getStartUser() {
		return startUser;
	}

	public void setStartUser(String startUser) {
		this.startUser = startUser;
	}

	public long getMillis() {
		return millis;
	}

	public void setMillis(long millis) {
		this.millis = millis;
	}
	
}
